import { baseURL } from '!/app.json'
import { request } from "./request";



/**
 *
 * 用户注册ip---中转aiUrl ip限制
 * @param mobile 手机号
 */
export const regAiUserApi: any = () => {
    return request.get(`${baseURL}Weixin/User/regAiUser`);
};

/**
 *
 * 获取wss链接
 * @param mobile 手机号
 */
export const getScocketUrl: any = () => {
    return request.get(`${baseURL}weixin/version/mqttXcx`);
};

/**
 *
 * 获取验证码
 * @param mobile 手机号
 * Weixin/Account/sendBjyMobileVerify --百家益
 * Weixin/Account/sendMobileVerify --分享E疗
 */
export const sendMobileCode: any = (data: any) => {
    return request.post(`${baseURL}Weixin/Account/sendMobileVerify`, { data });
};


/**
 *
 * 登录
 * @param mobile 手机号
 * @param code 验证码
 * @param uuid 
 */
export const getUserTokenByMobile: any = (data: any) => {
    return request.post(`${baseURL}Weixin/Account/getUserTokenByMobile`, { data });
};


/**
 *
 * emailLoginApi 邮箱登录
 * @param email 邮箱
 * @param password 
 */
export const emailLoginApi: any = (data: any) => {
    return request.post(`${baseURL}Weixin/OsAccount/eMailLogin`, { data });
};

/**
 *
 * getUserInfo  获取用户信息
 */
export const getUserInfo: any = (armariumScienceSession?: string) => {
    return request.get(`${baseURL}Weixin/User/getUserInfo?armariumScienceSession=${armariumScienceSession}`);
};

/**
 *
 * updateUserInfo  更新用户信息
 */
export const updateUserInfo: any = (data) => {
    return request.post(`${baseURL}Weixin/User/updateUserInfo`, { data });
};


/**
 *
 * sendRetrieveVerifyEmail 邮箱发送验证码
 *  @param email 邮箱
 */
export const sendRetrieveVerifyEmail: any = (data) => {
    return request.post(`${baseURL}Weixin/OsAccount/sendRetrieveVerify`, { data });
};

/**
 *
 * checkRegVerifyEmailCode 校验邮箱验证码
 *  @param email 邮箱
 *  @param uid 
 */
export const checkRegVerifyEmailCode: any = (data) => {
    return request.post(`${baseURL}Weixin/OsAccount/getRegVerify`, { data });
};


/**
 *
 * eMailRegApi 邮箱注册
 *  @param email 
 *  @param password 
 */
export const eMailRegApi: any = (data) => {
    return request.post(`${baseURL}Weixin/OsAccount/eMailReg`, { data });
};


/**
 *
 * recoveredPassword 修改密码
 *  @param email 
 *  @param password 
 */
export const recoveredPasswordApi: any = (data) => {
    return request.post(`${baseURL}Weixin/OsAccount/recoveredPassword`, { data });
};


/**
 *
 * recoveredPassword 修改密码
 *  @param email 
 *  @param password 
 */
export const RegisterJpushId: any = (data) => {
    return request.post(`${baseURL}Weixin/Rtc/saveRegId`, { data });
};